﻿@{
    Layout = "";
}
@model SmartStore.DiscountRules.Models.CustomerRoleModel
@using SmartStore.Web.Framework;
    
<table class="adminContent">
    <tr class="wide">
        <td class="adminTitle">
            @Html.SmartLabelFor(model => model.CustomerRoleId)
        </td>
        <td class="adminData">
			<div class="discount-rule-wrapper"
				 data-discount-id='@Model.DiscountId'
				 data-requirement-id='@Model.RequirementId'
				 data-action-url='@Url.Action("CustomerRole")'
				 data-fail-msg=@T("Admin.Promotions.Discounts.Requirements.FailedToSave").JsText
				 data-success-msg=@T("Admin.Promotions.Discounts.Requirements.Saved").JsText>
				<div>
					@Html.DropDownListFor(model => model.CustomerRoleId, Model.AvailableCustomerRoles, new { data_routeparam = "customerRoleId" })
					<button type="button" class="btn @(Model.RequirementId == 0 ? "btn-primary btn-block btn-lg" : "btn-warning") btn-save-discount-rule mt-3">
						<i class="fa fa-@(Model.RequirementId == 0 ? "plus" : "check")"></i>
						<span>@T(Model.RequirementId == 0 ? "Common.AddNew" : "Admin.Common.Save")</span>
					</button>
				</div>
			</div>
        </td>
    </tr>
</table>